package com.nanyang.tms.dao.saleprice;

import com.nanyang.tms.domain.saleprice.SalePriceDiscountDO;
import com.nanyang.tms.domain.saleprice.SalePriceDiscountVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.math.BigDecimal;
import java.util.List;

/**
 * <p>SalePriceDiscountDao.java</p>
 * <p>Description:()</p>
 *
 * @author lv
 * @date 2022年11月12日 下午05:46:06
 * @Copyright Copyright (c) 2020 www.nanyang.cn Inc. All rights reserved.
 */
@Mapper
public interface SalePriceDiscountDao {
    /**
     * <p>deleteByPrimaryKey</p>
     * <p>Description:(根据主键删除)</p>
     *
     * @param id
     * @return int
     */
    int deleteByPrimaryKey(Long id);

    /**
     * <p>insert</p>
     * <p>Description:(新增（所有列）)</p>
     *
     * @param record
     * @return int
     */
    int insert(SalePriceDiscountDO record);

    /**
     * <p>selectByPrimaryKey</p>
     * <p>Description:(根据主键查询)</p>
     *
     * @param id
     * @return SalePriceDiscountDO
     */
    SalePriceDiscountDO selectByPrimaryKey(Long id);

    /**
     * <p>updateByPrimaryKeySelective</p>
     * <p>Description:(修改(选择的列))</p>
     *
     * @param record
     * @return int
     */
    int update(SalePriceDiscountDO record);

    /**
     * 根据产品编码查询
     * @param saleProductCode
     * @return
     */
    List<SalePriceDiscountVO> selectByCode(String saleProductCode);

    /**
     * 根据编码查询
     * @param saleProductCode
     * @return
     */
    int deleteByCode(String saleProductCode);
    BigDecimal getDiscount(@Param(value = "saleProductCode") String saleProductCode,@Param(value = "levelCode") String levelCode);
}